#include <bits/stdc++.h>
// 2025/02/02
// tag: 
// Author: Zhang Muen
using namespace std;

int n, a[100001], diff[100001];

signed main()
{
    cin >> n;
    for (int i = 1; i <= n; i++)
        cin >> a[i];
    for (int i = 1; i <= n; i++)
        diff[i] = a[i] - a[i - 1];
    int64_t cnt1 = 0, cnt2 = 0;
    for (int i = 2; i <= n; i++)
    {
        if (diff[i] > 0)
            cnt1 += diff[i];
        else if (diff[i] < 0)
            cnt2 -= diff[i];
    }
    cout << max(cnt1, cnt2) << endl;
    cout << abs(cnt1 - cnt2) + 1 << endl;
    return 0;
}